Optimal. Leaf size=71 \[ \frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {79, 52, 65, 214}
\begin {gather*} \frac {\sqrt {a+b x} (2 a B+A b)}{a}-\frac {(2 a B+A b) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {A (a+b x)^{3/2}}{a x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 79
Rule 214
Rubi steps
\begin {align*} \int \frac {\sqrt {a+b x} (A+B x)}{x^2} \, dx &=-\frac {A (a+b x)^{3/2}}{a x}+\frac {\left (\frac {A b}{2}+a B\right ) \int \frac {\sqrt {a+b x}}{x} \, dx}{a}\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}+\frac {1}{2} (A b+2 a B) \int \frac {1}{x \sqrt {a+b x}} \, dx\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}+\frac {(A b+2 a B) \text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+b x}\right )}{b}\\ &=\frac {(A b+2 a B) \sqrt {a+b x}}{a}-\frac {A (a+b x)^{3/2}}{a x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 53, normalized size = 0.75 \begin {gather*} \frac {\sqrt {a+b x} (-A+2 B x)}{x}-\frac {(A b+2 a B) \tanh ^{-1}\left (\frac {\sqrt {a+b x}}{\sqrt {a}}\right )}{\sqrt {a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 50, normalized size = 0.70
method | result | size |
derivativedivides | \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) | \(50\) |
default | \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) | \(50\) |
risch | \(2 B \sqrt {b x +a}-\frac {A \sqrt {b x +a}}{x}-\frac {\left (A b +2 B a \right ) \arctanh \left (\frac {\sqrt {b x +a}}{\sqrt {a}}\right )}{\sqrt {a}}\) | \(50\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 76, normalized size = 1.07 \begin {gather*} \frac {1}{2} \, b {\left (\frac {4 \, \sqrt {b x + a} B}{b} + \frac {{\left (2 \, B a + A b\right )} \log \left (\frac {\sqrt {b x + a} - \sqrt {a}}{\sqrt {b x + a} + \sqrt {a}}\right )}{\sqrt {a} b} - \frac {2 \, \sqrt {b x + a} A}{b x}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.93, size = 124, normalized size = 1.75 \begin {gather*} \left [\frac {{\left (2 \, B a + A b\right )} \sqrt {a} x \log \left (\frac {b x - 2 \, \sqrt {b x + a} \sqrt {a} + 2 \, a}{x}\right ) + 2 \, {\left (2 \, B a x - A a\right )} \sqrt {b x + a}}{2 \, a x}, \frac {{\left (2 \, B a + A b\right )} \sqrt {-a} x \arctan \left (\frac {\sqrt {b x + a} \sqrt {-a}}{a}\right ) + {\left (2 \, B a x - A a\right )} \sqrt {b x + a}}{a x}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 155 vs.
\(2 (60) = 120\).
time = 5.57, size = 155, normalized size = 2.18 \begin {gather*} - \frac {A a b \sqrt {\frac {1}{a^{3}}} \log {\left (- a^{2} \sqrt {\frac {1}{a^{3}}} + \sqrt {a + b x} \right )}}{2} + \frac {A a b \sqrt {\frac {1}{a^{3}}} \log {\left (a^{2} \sqrt {\frac {1}{a^{3}}} + \sqrt {a + b x} \right )}}{2} + \frac {2 A b \operatorname {atan}{\left (\frac {\sqrt {a + b x}}{\sqrt {- a}} \right )}}{\sqrt {- a}} - \frac {A \sqrt {a + b x}}{x} + \frac {2 B a \operatorname {atan}{\left (\frac {\sqrt {a + b x}}{\sqrt {- a}} \right )}}{\sqrt {- a}} + 2 B \sqrt {a + b x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 2.07, size = 61, normalized size = 0.86 \begin {gather*} \frac {2 \, \sqrt {b x + a} B b - \frac {\sqrt {b x + a} A b}{x} + \frac {{\left (2 \, B a b + A b^{2}\right )} \arctan \left (\frac {\sqrt {b x + a}}{\sqrt {-a}}\right )}{\sqrt {-a}}}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.41, size = 49, normalized size = 0.69 \begin {gather*} 2\,B\,\sqrt {a+b\,x}-\frac {\mathrm {atanh}\left (\frac {\sqrt {a+b\,x}}{\sqrt {a}}\right )\,\left (A\,b+2\,B\,a\right )}{\sqrt {a}}-\frac {A\,\sqrt {a+b\,x}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________